<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件中的驼峰标识</title>
</head>
<body>
<div id="app">
    <cpn v-bind:c-message="message" v-bind:c-obj="obj"></cpn>
</div>
<template id="cpn">
    <div>
        <h2>{{cMessage}}</h2>
        <h1>{{cObj}}</h1>
    </div>
</template>
<script src="../../js/vue.js"></script>
<script>
    const cpnc = ({
        template: "#cpn",
        props: ({
            cMessage: {
                type: String,
                default: "Hello World",
                required: true,
            },
            cObj: {
                type: Object,
                default() {
                    return {}
                },
            }
        })
    });
    Vue.component('cpn', cpnc);
    new Vue({
        el: "#app",
        data: {
            message: "你好，世界",
            obj: {
                name: 'jason',
                age: 18,
                height: 1.88,
                isHandsome: true,
            }
        }
    })
</script>
</body>
</html>